package com.ziqing.apeletnews.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.ziqing.apeletnews.R;
import com.ziqing.apeletnews.adapter.CityAdapter;
import com.ziqing.apeletnews.base.BaseActivity;
import com.ziqing.apeletnews.baseMvp.BasePresenter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by YYJ on 2018/4/28.
 */

public class EditAddressActivity extends BaseActivity {
    @BindView(R.id.tv_location)
    TextView tvLocation;
    @BindView(R.id.rv_city)
    RecyclerView rvCity;

    private List<String> data = new ArrayList<>();
    private CityAdapter adapter;


    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_address);
        ButterKnife.bind(this);
        setTitle("城市列表");
        setUpToolbar(R.drawable.icon_back);
        initData();
    }

    private void initData() {
        data.add("北京");
        data.add("上海");
        data.add("天津");
        data.add("重庆");
        data.add("香港");
        data.add("澳门");
        data.add("台湾");
        data.add("安徽");
        data.add("福建");
        data.add("甘肃");
        data.add("广东");
        data.add("广西");
        data.add("贵州");
        data.add("海南");
        data.add("河北");
        data.add("河南");
        data.add("黑龙江");
        data.add("湖北");
        data.add("湖南");
        data.add("吉林");
        data.add("江苏");
        data.add("江西");
        data.add("辽宁");
        data.add("内蒙古");
        data.add("宁夏");
        data.add("青海");
        data.add("山东");
        data.add("山西");
        data.add("陕西");
        data.add("四川");
        data.add("西藏");
        data.add("新疆");
        data.add("云南");
        data.add("浙江");
        rvCity.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        adapter = new CityAdapter(this,data,R.layout.item_recycler_city);
        rvCity.setAdapter(adapter);
        adapter.notifyDataSetChanged();
        rvCity.setNestedScrollingEnabled(false);
        rvCity.setFocusable(false);
        rvCity.setHasFixedSize(true);
    }


}
